Even or odd?
by Yuk '24
def odd_even(n):
if n < 100:
return n % 2 == 0
else:
return n % 2 != 0
Function Call | Return Value | |||
---|---|---|---|---|
odd_even(5) | → | |||
odd_even(22) | → | |||
odd_even(122) | → | |||
odd_even(75) | → | |||
odd_even(98) | → | |||
odd_even(1001) | → |
Experiment with this code on Gitpod.io